﻿using System;
using System.Collections.Generic;
using System.Windows.Navigation;

namespace Liphofra.Mvvm.Navigation
{
    /// <summary>
    /// An abstraction of the navigation features of the navigation service on Windows Phone.
    /// </summary>
    public interface INavigationService
    {
        /// <summary>
        /// Gets a value indicating whether backward navigation can be performed.
        /// </summary>
        /// <value>
        /// <c>true</c> if backward navigation is possible; otherwise, <c>false</c>.
        /// </value>
        bool CanGoBack
        {
            get;
        }

        /// <summary>
        /// Gets the back stack of the navigation.
        /// </summary>
        IEnumerable<JournalEntry> BackStack
        {
            get;
        }

        /// <summary>
        /// Navigates forward to the specified content source.
        /// </summary>
        /// <param name="source">The source to navigate to.</param>
        /// <returns><c>true</c> if navigation was successful; otherwise, <c>false</c>.</returns>
        bool Navigate(Uri source);

        /// <summary>
        /// Invokes backward navigation of one page.
        /// </summary>
        void GoBack();

        /// <summary>
        /// Removes the most current back stack entry from the navigation stack.
        /// </summary>
        /// <returns>The entry that was removed from the navigation stack.</returns>
        JournalEntry RemoveBackEntry();
    }
}